package com.jimmy.myrule;

import com.netflix.loadbalancer.IRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version 1.0
 * @ ClassName MySelfRule
 * <p> TODO
 * @ author JIMMY
 * @ Date 2020/11/16 0016 下午 11:11
 */
@Configuration
public class MySelfRule
{
    @Bean
    public IRule myRule()
    {
        //return new RandomRule();// Ribbon默认是轮询，我自定义为随机
        //return new RoundRobinRule();// Ribbon默认是轮询，我自定义为随机

        return new RandomRule_Zm();// 我自定义为每台机器5次
    }
}

